class Solution(object):
    def findTheDifference(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        s = list(s)
        t = list(t)

        s.sort()
        t.sort()

        for i, c in enumerate(t[0:-1]):
            if s[i] != c:
                return c

        return t[-1]

s = Solution()
print(s.findTheDifference("abcd", "abcde"))
